Automated Presentation of directory src/exampleCode/csg/

HUB | Up | Download | Pheedbak | Tree | Topic | A-Z | Search | Hot | New


Please be aware: what appears below are the v4.2 DT bits in auto-generated html form.
As we have the time, we will update these to reflect the current "state of the world".


README file from "csg" directory

              ~4Dgifts/toolbox/src/exampleCode/csg README


    csg demos implementation of boolean operations with stencil planes.


    the file csg-paper.txt is the copy of a paper by Kurt Akeley titled, 
    "Constructive Solid Geometry, Stencil planes and solid geometry 
    applications"


    csg.c draws a CSG object - a cube with a hole drilled through the
    center.  The stencil planes are used to determine where the cube
    should be drawn and where the cylinder should be drawn.

    There are several things to bear in mind.  The cube is drawn
    "normally"; that is, with its back faces removed.  The cylinder is
    subtracted from the cube, so only its BACK faces will show.  Also,
    the cube is NOT drawn wherever it is inside the cylinder.  The stencil
    planes and the z-buffer are used together to figure out where the
    cube is inside the cylinder.
  
    The drawscene() routine does the CSG.  The basic algorithm is as
    follows:
               1  Turn off drawing.
               2  Render the cube's z-values into the z-buffer planes.
               3  Use the stencil and the z-buffer comparison hardware
                    to count how many times the cylinder is drawn in
                    front of the cube.
               4  Wherever exactly one face of the cylinder is in front
                    of the cube (in other words, the cube is between
                    or inside the cylinder), force z-values to the
                    largest possible z, because these pixels are inside
                    the hole in the cube.
               5  Render the cube's back faces into this hole as needed (to
                    clip the back of the cylinder).
               6  Render the cylinder's z-values into this hole as needed.
               7  Turn drawing on.
               8  Render the cube and cylinder where their z-values equal
                    the values in the z-buffer planes.



Files of interest from "src/exampleCode/csg" directory

Source

Documentation

Reference


Select any combo of files you'd like to send yourself a compressed tar image of. Executables/scripts are indicated with a trailing `*' character. (Depending upon the browser, it may be necessary to hold down the Ctrl key to select/deselect disjoint items.) a compressed tar image of the above-selected items.
OR, ...
a compressed tar image of the entire csg directory.

Copyright © 1995, Silicon Graphics, Inc.